package com.example.demo.mapper;

import com.example.demo.entity.Coupon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface CouponMapper {
    int insertCoupon(Coupon coupon);
    Coupon selectCouponByName(@Param("name") String name);
    
    int updateCoupon(Coupon coupon);
    
    Coupon selectCouponById(@Param("id") Integer id);

    int updateCouponStatus(@Param("id") Integer id, @Param("status") Integer status);
    
    List<Coupon> selectCouponsByKeyword(@Param("keyword") String keyword);
    
    List<Coupon> selectAllCoupons();
    
    int deleteCoupon(@Param("id") Integer id);
}
